#ifndef __PTGUI_COLOR_H__
#define __PTGUI_COLOR_H__

typedef rt_uint32_t ptgui_color_t;

#define PTGUI_ARGB(a, r, g, b)	\
		((ptgui_color_t)(((rt_uint8_t)(r)|\
		(((unsigned)(rt_uint8_t)(g))<<8))|\
		(((unsigned long)(rt_uint8_t)(b))<<16)|\
		(((unsigned long)(rt_uint8_t)(a))<<24)))
#define PTGUI_RGB(r, g, b)	PTGUI_ARGB(255, (r), (g), (b))

#define PTGUI_RGB_R(c)	((c) & 0xff)
#define PTGUI_RGB_G(c)	(((c) >> 8)  & 0xff)
#define PTGUI_RGB_B(c)	(((c) >> 16) & 0xff)
#define PTGUI_RGB_A(c)	(((c) >> 24) & 0xff)

#define COLOR_DEFAULT_FOREGROUND PTGUI_RGB(0xFF, 0x00, 0x00)
#define COLOR_DEFAULT_BACKGROUND PTGUI_RGB(212, 208, 200)
#define COLOR_SELECTED_COLOR PTGUI_RGB(0xc0, 0xc0, 0xc0)

#define COLOR_RED 	PTGUI_RGB(0xff, 0x00, 0x00)
#define COLOR_GREEN 	PTGUI_RGB(0x00, 0xff, 0x00)
#define COLOR_BLUE 	PTGUI_RGB(0x00, 0x00, 0xff)
#define COLOR_BLACK 	PTGUI_RGB(0x00, 0x00, 0x00)
#define COLOR_WHITE 	PTGUI_RGB(0xff, 0xff, 0xff)

#define COLOR_HIGH_LIGHT 	PTGUI_RGB(0xff, 0xff, 0xff)
#define COLOR_DARK_GREY 	PTGUI_RGB(0x7f, 0x7f, 0x7f)
#define COLOR_LIGHT_GREY 	PTGUI_RGB(0xc0, 0xc0, 0xc0)

#define PTGUI_RGB_R(c)	((c) & 0xff)
#define PTGUI_RGB_G(c)	(((c) >> 8)  & 0xff)
#define PTGUI_RGB_B(c)	(((c) >> 16) & 0xff)
#define PTGUI_RGB_A(c)	(((c) >> 24) & 0xff)

rt_uint16_t ptgui_color_to_565(ptgui_color_t c);
ptgui_color_t ptgui_color_from_565(rt_uint16_t pixel);
rt_uint16_t ptgui_color_to_565p(ptgui_color_t c);
ptgui_color_t ptgui_color_from_565p(rt_uint16_t pixel);

#endif

